package com.yixun.qfbao.common.model;


import com.alibaba.fastjson.JSONObject;
import com.github.sd4324530.fastexcel.annotation.MapperCell;
import com.yixun.qfbao.common.excel.FastExcel;
import net.sf.oval.constraint.NotBlank;

import java.util.List;

public class CustomerPremisesModel {

	@MapperCell(cellName = "序号")
	private String seqNumber;

	//@NotBlank(message = "经纪人姓名不能为空")
	@MapperCell(cellName = "经纪人姓名")
	private String agentName;

	//@NotBlank(message = "经纪人手机不能为空")
	@MapperCell(cellName = "经纪人手机")
	private String agentPhone;

	//@NotBlank(message = "客户名称不能为空")
	@MapperCell(cellName = "客户姓名")
	private String name;

	//@NotBlank(message = "客户手机不能为空")
	@MapperCell(cellName = "客户手机")
	private String mobile;

	//@NotBlank(message = "客户性别不能为空")
	@MapperCell(cellName = "客户性别")
	private String gender;

	@MapperCell(cellName = "错误原因")
	private String error;

	private Long staffId;

	private Long staffCompany;

	public String getSeqNumber() {
		return seqNumber;
	}

	public void setSeqNumber(String seqNumber) {
		this.seqNumber = seqNumber;
	}

	public String getAgentName() {
		return agentName;
	}

	public void setAgentName(String agentName) {
		this.agentName = agentName;
	}

	public String getAgentPhone() {
		return agentPhone;
	}

	public void setAgentPhone(String agentPhone) {
		this.agentPhone = agentPhone;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getError() {
		return error;
	}

	public void setError(String error) {
		this.error = error;
	}

	public Long getStaffId() {
		return staffId;
	}

	public void setStaffId(Long staffId) {
		this.staffId = staffId;
	}

	public Long getStaffCompany() {
		return staffCompany;
	}

	public void setStaffCompany(Long staffCompany) {
		this.staffCompany = staffCompany;
	}

	public static void main(String[] args){
		try{
			//解析Excel数据并转为java实体bean
			FastExcel fastExcel=new FastExcel("D://import_cuspre.xlsx");
			fastExcel.setStartRow(1);
			List<CustomerPremisesModel> customerList = fastExcel.parse(CustomerPremisesModel.class);
			fastExcel.close();

			System.out.println(JSONObject.toJSONString(customerList));
		}catch (Exception ex){
			ex.printStackTrace();
		}

	}

}
